package ui.common
{
	import adapter.common.DynamicObjectAdapter;
	import flash.events.Event;

	/**
	 * @author Administrator
	 */
	public class DynamicObject extends SpriteObject
	{
		public function DynamicObject()
		{
		}
		
		protected function get dynamicObjectAdapter():DynamicObjectAdapter
		{
			return adapter as DynamicObjectAdapter;
		}
		
		override public function create():void
		{
			super.create();
			addEventListener(Event.ENTER_FRAME, onFrame);
		}
		
		override public function destory():void
		{
			removeEventListener(Event.ENTER_FRAME, onFrame);
			super.destory();
		}
		
		protected function onFrame(e:Event):void
		{
			if(dynamicObjectAdapter)
			{
				dynamicObjectAdapter.onFrame();
			}
		}
	}
}
